<template>
	<view style="margin-left: 50rpx;margin-right: 50rpx;">
		<!-- 注意，如果需要兼容微信小程序，最好通过setRules方法设置rules规则 -->
		<view style="text-align: center;">编辑资料</view>
		<u--form :model="datas" :rules="rules" ref="uForm">
			<!-- 选项模板 -->
			<view v-if="steps_id==0">
				<u-steps v-if="modify==1" current="0" style="margin-top: 15px;">
					<u-steps-item v-for="item in steps" :title="item"></u-steps-item>
				</u-steps>
				<u-form-item v-if="modify==1" label="选择模板" borderBottom ref="item1">
					<u-radio-group placement="row">
						<u-radio style="margin-right: 20px;" :customStyle="{marginBottom: '8px'}"
							v-for="(item, index) in radiolist0" :key="index" :label="item.name" :name="item.name"
							@change="radioChange0"> </u-radio>
					</u-radio-group>
				</u-form-item>
				<button @click="nrxt_step">下一步</button>
			</view>
			<!-- 编辑资料 -->
			<view v-else-if="steps_id==1">
				<u-steps current="1" style="margin-top: 15px;">
					<u-steps-item v-for="item in steps" :title="item"></u-steps-item>
				</u-steps>
				<u-form-item v-if="datas.mb==1" label="背景图片" borderBottom ref="item1"><!-- 头像-->
					<u-upload :fileList="fileList0" @afterRead="afterRead" @delete="deletePic" name="0" border="none"
						multiple :maxCount="1"></u-upload>
				</u-form-item>
				<u-form-item :label="add_modify+'头像'" borderBottom ref="item1"><!-- 头像-->
					<u-upload :fileList="fileList1" @afterRead="afterRead" @delete="deletePic" name="1" border="none"
						multiple :maxCount="3"></u-upload>
				</u-form-item>
				<u-form-item :label="eill_modify+'姓名'" borderBottom ref="item1" prop="name"><!-- -->
					<u--input v-model="datas.name" style="background-color: #ffffff;" border="none"
						placeholder="请输入姓名"></u--input>
				</u-form-item>
				<u-form-item v-if="modify==1" label="性别" borderBottom ref="item1">
					<u-radio-group placement="row">
						<u-radio style="margin-right: 20px;" :customStyle="{marginBottom: '8px'}"
							v-for="(item, index) in radiolist1" :key="index" :label="item.name" :name="item.name"
							@change="radioChange0"> </u-radio>
					</u-radio-group>
				</u-form-item>
				<u-form-item :label="eill_modify+'民族'" borderBottom ref="item1" prop="nationality">
					<u--input v-model="datas.nationality" style="background-color: #ffffff;" border="none"
						placeholder="请输入民族"></u--input>
				</u-form-item>
				<u-form-item :label="eill_modify+'出生日期'" borderBottom ref="item1">
					<picker mode=date :value="datas.birthDate" start="1800-10-10"
						:end="$u.timeFormat(timestamp, 'yyyy-mm-dd')" @change="bindDateChange">
						<view class="uni-input" style="background-color: #ffffff;width: 200rpx;height: 40rpx;">
							{{datas.birthDate}}</view>
					</picker>
				</u-form-item>
				<u-form-item v-if="datas.mb==0" label="仙逝日期" borderBottom ref="item1">
					<picker mode=date :value="datas.dieDate" start="1800-10-10"
						:end="$u.timeFormat(timestamp, 'yyyy-mm-dd')" @change="bindDateChange1">
						<view class="uni-input" style="background-color: #ffffff;width: 200rpx; height: 40rpx;">
							{{datas.dieDate}}</view>
					</picker>
				</u-form-item>
				<u-form-item :label="eill_modify+'祖籍地址'" borderBottom ref="item1" prop="address">
					<u--input v-model="datas.address" style="background-color: #ffffff;" border="none"
						placeholder="请输入祖籍地址"></u--input>
				</u-form-item>
				<button v-if="modify==1" @click="steps_id-=1">上一步</button>
				<button @click="steps_id+=1">下一步</button>
			</view>
			<view v-else-if="steps_id==2">
				<u-steps current="2" style="margin-top: 15px;">
					<u-steps-item v-for="item in steps" :title="item"></u-steps-item>
				</u-steps>
				<u-form-item :label="eill_modify+'人物简介'" borderBottom ref="item1" prop="content">
					<u--textarea v-model="datas.content" maxlength="-1" style="background-color: #ffffff;" border="none"
						placeholder="请输入人物简介"></u--textarea>
				</u-form-item>
				<u-form-item :label="add_modify+'简介图片'" borderBottom ref="item1">
					<u-upload :fileList="fileList2" @afterRead="afterRead" @delete="deletePic" name="2" border="none"
						multiple :maxCount="3"></u-upload>
				</u-form-item>
				<u-form-item :label="add_modify+'视频简介'" borderBottom ref="item1">
					<u-upload :fileList="fileList6" @afterRead="afterRead" @delete="deletePic" name="6" multiple
						border="none" :maxCount="1" accept="video"></u-upload>
				</u-form-item>
				<button @click="steps_id-=1">上一步</button>
				<button @click="steps_id+=1">下一步</button>
			</view>
			<view v-else-if="steps_id==3">
				<u-steps current="3" style="margin-top: 15px;">
					<u-steps-item v-for="item in steps" :title="item"></u-steps-item>
				</u-steps>
				<u-form-item :label="add_modify+'视频'" borderBottom ref="item1">
					<u-upload :fileList="fileList3" @afterRead="afterRead" @delete="deletePic" name="3" multiple
						border="none" :maxCount="10" accept="video"></u-upload>
				</u-form-item>
				<u-form-item :label="add_modify+'相册'" borderBottom ref="item1">
					<u-upload :fileList="fileList4" @afterRead="afterRead" @delete="deletePic" name="4" border="none"
						multiple :maxCount="1000"></u-upload>
				</u-form-item>
				<button @click="steps_id-=1">上一步</button>
				<button @click="steps_id+=1">下一步</button>
			</view>
			<view v-else-if="steps_id==4">
				<u-steps current="4" style="margin-top: 15px;">
					<u-steps-item v-for="item in steps" :title="item"></u-steps-item>
				</u-steps>
				<u-form-item :label="add_modify+'人物关系'" borderBottom ref="item1">
					<u-button text="新增" @click="show=true"></u-button>
				</u-form-item>
				<view>
					<u-popup :show="show1" @close="close" customStyle="width: 606rpx; height: 790rpx;" mode="center"
						round="20">
						<u--form>
							<u-form-item :label="add_modify+'头像'" borderBottom ref="item1">
								<u-upload :fileList="fileList5" @afterRead="afterRead" @delete="deletePic" name="5"
									border="none" multiple :maxCount="1"></u-upload>
							</u-form-item>
							<u-form-item :label="eill_modify+'姓名'" borderBottom ref="item1" prop="name">
								<u--input v-model="rbc.name" style="background-color: #ffffff;" border="none"
									placeholder="请输入姓名"></u--input>
							</u-form-item>
							<u-form-item :label="eill_modify+'关系'" borderBottom ref="item1" prop="name">
								<u--input v-model="rbc.guanxi" style="background-color: #ffffff;" border="none"
									placeholder="请输入关系"></u--input>
							</u-form-item>
							<u-form-item :label="eill_modify+'亲友介绍'" borderBottom ref="item1" prop="name">
								<u--input v-model="rbc.des" style="background-color: #ffffff;" border="none"
									placeholder="请输入姓名亲友介绍"></u--input>
							</u-form-item>
							<u-button text="取消修改" @click="cancel"></u-button>
							<u-button text="更新修改" @click="update"></u-button>
							<u-button text="删除" @click="delate"></u-button>
						</u--form>

					</u-popup>
				</view>
				<view style="margin-bottom: 76.7rpx;">
					<u-grid :border="false" col="4">
						<u-grid-item v-for="(listItem,listIndex) in list" :key="listIndex"
							@click="character(listIndex)">
							<image class="v_if_img" :src="oss_host+listItem.image.url"></image>
							<text class="grid-text V_if_text0">{{listItem.name}}</text>
							<text class="grid-text V_if_text1">{{listItem.guanxi}}</text>
						</u-grid-item>
					</u-grid>
				</view>
				
				<u-form-item label="是否密码访问" borderBottom ref="item1">
					<view >
						<uni-data-checkbox v-model="datas.is_accpass" :localdata="range" @change="change"></uni-data-checkbox>
						<radio-group @change="radioChange">
							<label  v-for="(item, index) in items" :key="item.value">
								<view>
									<radio :value="item.value" :checked="index == datas.is_accpass" />
									<text>{{item.name}}</text>
								</view>
								
							</label>
						</radio-group>
					</view>
				</u-form-item>
				<u-form-item v-if="datas.is_accpass==1" label="客户访问的密码" borderBottom ref="item1">
					<u--input v-model="datas.accpass" style="background-color: #ffffff;" border="none"
						placeholder="请输入客户访问的密码"></u--input>
				</u-form-item>
				<u-form-item :label="add_modify+'编辑人手机号'" borderBottom ref="item1" prop="makePhone">
					<u--input v-model="datas.makePhone" style="background-color: #ffffff;" border="none"
						placeholder="请输入编辑人员手机号"></u--input>
				</u-form-item>
				
				
				<u-form-item :label="eill_modify+'制作单位'" borderBottom ref="item1" prop="makeDw">
					<u--input v-model="datas.makeDw" style="background-color: #ffffff;" border="none"
						placeholder="请输入填作单位"></u--input>
				</u-form-item>
				<u-form-item :label="eill_modify+'资料来源'" borderBottom ref="item1" prop="makeLy">
					<u--input v-model="datas.makeLy" style="background-color: #ffffff;" border="none"
						placeholder="请输入资料来源"></u--input>
				</u-form-item>
				<view class="from_tips_text">{{from_tips}}</view>
				<button @click="steps_id-=1">上一步</button>
				<button @click="add">提交信息</button>
			</view>
		</u--form>
		<view>
			<u-popup :show="show" @close="close" customStyle="width: 606rpx; height: 790rpx;" mode="center"
				:closeable="true" round="20">
				<u--form>
					<u-form-item :label="add_modify+'头像'" borderBottom ref="item1"><!-- 头像-->
						<u-upload :fileList="fileList5" @afterRead="afterRead" @delete="deletePic" name="5"
							border="none" multiple :maxCount="1"></u-upload>
					</u-form-item>
					<u-form-item :label="eill_modify+'姓名'" borderBottom ref="item1" prop="name"><!-- -->
						<u--input v-model="put.name" style="background-color: #ffffff;" border="none"
							placeholder="请输入姓名"></u--input>
					</u-form-item>
					<u-form-item :label="eill_modify+'关系'" borderBottom ref="item1" prop="name"><!-- -->
						<u--input v-model="put.guanxi" style="background-color: #ffffff;" border="none"
							placeholder="请输入关系"></u--input>
					</u-form-item>
					<u-form-item :label="eill_modify+'亲友介绍'" borderBottom ref="item1" prop="name"><!-- -->
						<u--input v-model="put.des" style="background-color: #ffffff;" border="none"
							placeholder="请输入姓名亲友介绍"></u--input>
					</u-form-item>
					<u-button text="确定" @click="addrow"></u-button>
				</u--form>

			</u-popup>
			<view>
				<u-toast ref="uToast"></u-toast>
			</view>
		</view>
		<view>
			<u-toast ref="uToast"></u-toast>
		</view>
	</view>
</template>

<script>
	import {
		oss_host,
		api_host
	} from '../../utils/appInfo';
	export default {
		data() {
			return {
				oss_host: oss_host,
				steps_id: 0,
				steps: ["选择模板", "填写资料", "填写简介", "添加视频及其相册", "添加人物关系及其资料"],
				fileList0: [], //背景图
				fileList1: [], //头像
				fileList2: [], //简介图片
				fileList3: [], //视频
				fileList4: [], //相册
				fileList5: [],
				fileList6: [], //简介视频
				show: false,
				show1: false,
				show2:false,
				timestamp: Date.parse(new Date()),
				datas: {
					id: 0,
					password: "",
					name: "",
					age: -1,
					is_accpass:0,
					accpass:"",
					makePhone:"",
					nationality: "",
					mb: -1,
					dieDate: "2000-01-01",
					birthDate: "2000-01-01",
					dieAge: 0,
					address: "", //祖籍地址
					content: "", //人物简介
					video_cover: "", //背景图片
					banner: [], //头像
					introduct_image: [], //简介图片
					introduct_video: "",
					u_video: [], //相关视频
					u_image: [], //相册
					makeDw: "", //制作单位
					makeLy: "", //资料来源
					u_guanxi: [],
				},
				list: [],
				rbc: {
					image: {},
					name: "",
					guanxi: "",
					des: ""
				},
				put: {
					image: {},
					name: "",
					guanxi: "",
					des: ""
				},
				radiolist0: [{
					name: '故人模板',
					disabled: false
				}, {
					name: '在世之人模板',
					disabled: false
				}],
				radiolist1: [{
					name: '男',
					disabled: true
				}, {
					name: '女',
					disabled: false
				}],
				rules: {
					name: {
						type: "string",
						required: true,
						message: '请填写姓名',
						trigger: ['blur', 'change']
					},
					nationality: {
						type: "string",
						required: true,
						message: '请填民族',
						trigger: ['blur', 'change']
					},
					address: {
						type: "string",
						min: 5,
						required: true,
						message: '请填祖籍地址',
						trigger: ['blur', 'change']
					},
					content: {
						type: "string",
						min: 10,
						required: true,
						message: '请填写人物简介,至少10位字符',
						trigger: ['blur', 'change']
					},
					makeDw: {
						type: "string",
						min: 3,
						required: true,
						message: '请填写制作单位',
						trigger: ['blur', 'change']
					},
					makeLy: {
						type: "string",
						min: 3,
						required: true,
						message: '请填写资料来源',
						trigger: ['blur', 'change']
					},
					makePhone:{
						type: "string",
						min: 11,
						max:11,
						required: true,
						message: '手机号长度错误',
						trigger: ['blur', 'change']
					}
				},
				items: [{
				        value: '0',
				        name: '不需要密码验证，即可访问'
				    },
				    {
				        value: '1',
				        name: '需要密码验证'
				    }
				],
				from_tips: "",
				add_modify: "添加",
				eill_modify: "填写",
				modify: 1, //修改模板的判断
				list_index: 0,
				list1:[
					{
						type: 'error',
						icon: false,
						title: '失败主题',
						message: "图片或视频上传失败",
						iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/error.png'
					},
				]
			};
		},
		onLoad(res) {
			this.datas.id = res.id
			this.modify = res.modify
			this.datas.password = res.password
			// this.datas.status=res.status
			if (this.modify == 0) {
				this.steps_id = 1
				this.add_modify = ""
				this.eill_modify = ""
				this.steps = ["选择模板", "修改资料", "修改简介", "修改视频及其视频", "修改人物关系及其资料"]
				this.getEdit()
			}
		},
		computed: {
			getIcon() {
				return path => {
					return 'https://cdn.uviewui.com/uview/example/' + path + '.png';
				}
			},
		},
		methods: {
			//读取编辑数据api
			getEdit() {
				this.api.getEdit({
					id: this.datas.id
				}).then(res => {
					console.log(res.data)
					this.datas.accpass=res.data.accpass
					this.datas.is_accpass=res.data.is_accpass
					this.datas.makePhone=res.data.makePhone
					this.datas.id = res.data.id
					this.datas.password = res.data.pass
					this.datas.name = res.data.name
					this.datas.age = res.data.age
					this.datas.nationality = res.data.nationality
					this.datas.mb = res.data.mb
					this.datas.dieDate = res.data.dieDate
					this.datas.birthDate = res.data.birthDate
					this.datas.dieAge = res.data.dieAge
					this.datas.address = res.data.address
					this.datas.content = res.data.content
					this.datas.video_cover = res.data.video_cover
					this.datas.banner = res.data.banner
					this.datas.introduct_image = res.data.introimages.split(",")
					this.datas.introduct_video = res.data.video_src
					this.datas.u_video = res.data.u_video
					this.datas.u_image = res.data.u_image
					this.datas.makeDw = res.data.makeDw
					this.datas.makeLy = res.data.makeLy
					this.datas.u_guanxi = res.data.u_guanxi
					for (let i = 0; i < this.datas.banner.length; i++) {
						this.fileList1.push({
							url: oss_host + this.datas.banner[i]
						})
					}
					for (let i = 0; i < this.datas.u_guanxi.length; i++) {
						this.list.push({
							id: this.datas.u_guanxi[i].id,
							image: {
								url: this.datas.u_guanxi[i].image
							},
							name: this.datas.u_guanxi[i].name,
							guanxi: this.datas.u_guanxi[i].guanxi,
							des: this.datas.u_guanxi[i].des
						})
					}
					for (let i = 0; i < this.datas.u_video.length; i++) {
						this.fileList3.push({
							url: oss_host + this.datas.u_video[i]
						})
					}
					for (let i = 0; i < this.datas.u_image.length; i++) {
						this.fileList4.push({
							url: oss_host + this.datas.u_image[i]
						})
					}
					for (let i = 0; i < this.datas.introduct_image.length; i++) {
						this.fileList2.push({
							url: oss_host + this.datas.introduct_image[i]
						})
					}
					this.fileList0.push({
						url: oss_host + this.datas.video_cover
					})
					this.fileList6.push({
						url: oss_host + this.datas.introduct_video
					})
				})
			},
			nrxt_step() {
				if (this.datas.mb !=- 1) {
					this.steps_id += 1
					if (this.datas.mb == 1) {
						this.datas.dieDate = ""
					}
				}
			},
			cancel() {
				this.show1 = false
				this.fileList5 = []
			},
			close() {
				this.show = false
				this.show1 = false
			},
			bindDateChange(e) {
				this.datas.birthDate = e.detail.value
			},
			bindDateChange1(e) {
				this.datas.dieDate = e.detail.value
			},
			radioChange0(n) {
				if (n == "男") {
					this.datas.age = 0
				} else if (n == "女") {
					this.datas.age = 1
				} else if (n == "故人模板") {
					this.datas.mb = 0
				} else if (n == "在世之人模板") {
					this.datas.mb = 1
					this.datas.dieDate = ""
				}
				
			},
			// 删除图片
			deletePic(event) {
				console.log(event)
				this[`fileList${event.name}`].splice(event.index, 1)
				if (event.name == 0) { //头部背景
					for (let i = 0; i < this.fileList1.length; i++) {
						this.datas.video_cover = this.fileList0[i].url
					}
					this.datas.video_cover = ""
				} else if (event.name == 1) { //头像
					for (let i = 0; i < this.fileList1.length; i++) {
						this.datas.banner[i] = this.fileList1[i]
					}
					this.datas.banner.length -= 1
				} else if (event.name == 2) { //头像
					for (let i = 0; i < this.fileList2.length; i++) {
						this.datas.introduct_image[i] = this.fileList2[i]
					}
					this.datas.introduct_image.length -= 1
				} else if (event.name == 3) { //相关视频
					for (let i = 0; i < this.fileList3.length; i++) {
						this.datas.u_video[i] = this.fileList3[i]
					}
					this.datas.u_video.length -= 1
				} else if (event.name == 4) { //相册
					for (let i = 0; i < this.fileList4.length; i++) {
						this.datas.u_image[i] = this.fileList4[i]
					}
					this.datas.u_image.length -= 1
				} else if (event.name == 5) { //相册
					this.put.image = {}
				} else if (event.name == 6) {
					this.datas.introduct_video = ''
				}
			},
			showToast(params) {
				this.$refs.uToast.show({
					...params,
					complete() {
						// params.url && uni.navigateTo({
						// 	url: params.url
						// })
					}
				})
			},
			// 新增图片
			async afterRead(event) {
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					if(result==0){
						this.showToast(this.list1[0])
						this.deletePic(event)
					}
					let item = this[`fileList${event.name}`][fileListLen]
					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
					
				}
				console.log(this[`fileList${event.name}`])
				console.log(this[`fileList${event.name}`])
				if (event.name == 0) { //顶部背景
					for (let i = 0; i < this.fileList0.length; i++) {
						this.datas.video_cover = this.fileList0[i].url
					}
				} else if (event.name == 1) { //头像
					for (let i = 0; i < this.fileList1.length; i++) {
						this.datas.banner[i] = this.fileList1[i].url
					}
				} else if (event.name == 2) { //简介图片
					for (let i = 0; i < this.fileList2.length; i++) {
						this.datas.introduct_image[i] = this.fileList2[i].url
					}
				} else if (event.name == 3) { //相关视频
					for (let i = 0; i < this.fileList3.length; i++) {
						this.datas.u_video[i] = this.fileList3[i].url
					}
				} else if (event.name == 4) { //相册
					for (let i = 0; i < this.fileList4.length; i++) {
						this.datas.u_image[i] = this.fileList4[i].url
					}
				} else if (event.name == 5) { //相册
					for (let i = 0; i < this.fileList5.length; i++) {
						this.put.image = {
							url: this.fileList5[i].url
						}
					}
				} else if (event.name == 6) { //简介视频
					for (let i = 0; i < this.fileList6.length; i++) {
						this.datas.introduct_video = this.fileList6[i].url
					}
				}
				
			},
			uploadFilePromise(url) {
				return new Promise((resolve, reject) => {
					let a = uni.uploadFile({
						url: api_host + 'api/common/upload/', // 仅为示例，非真实的接口地址 这个地方穿我们的上传接口
						filePath: url,
						name: 'file',
						success: (res) => {
							let arr = JSON.parse(res.data);
							if(arr.code==1){
								setTimeout(() => {
									resolve(arr.data.url)
								}, 1000)
							}else {
								resolve(arr.code)
							}
						}
					});
				})
			},
			getAge() {
				var nowdate
				if (this.datas.dieDate != "") {
					nowdate = new Date(this.datas.dieDate.replace(/-/g, "/"));
				} else {
					nowdate = new Date()
				}
				var birth = new Date(this.datas.birthDate.replace(/-/g, "/"));
				var age = ((nowdate - birth) / 1000 / 60 / 60 / 24 / 365);
				return Math.trunc(age);
			},
			//添加/更新
			add() {
				this.datas.dieAge = this.getAge()
				this.datas.u_guanxi = this.list
				const date1 = new Date(this.datas.birthDate);
				const date2 = new Date(this.datas.dieDate);
				if (this.datas.md == 0 && date1.getTime() > date2.getTime()) { //返回错误信息
					this.from_tips = "时间顺序错误"
				} else if (this.datas.md == 0 && date1.getTime() == date2.getTime()) { //返回错误信息
					this.from_tips = "时间相同"
				} else { //执行向后台传送数据
					this.from_tips = ""
					this.api.edit(this.datas).then(res => {
						if (res.data.status == 1) {
							uni.navigateTo({
								url:"../judgment/correct?id="+this.datas.id+"&mb="+this.datas.mb
							})
						}
					})
				}
			},
			close() {
				this.fileList5 = []
				this.put.name = ""
				this.put.image = {}
				this.put.guanxi = ""
				this.put.des = ""
				this.show = false
			},
			addrow() {
				var guanxi_id = 0
				if (this.list.length == 0) {
					guanxi_id - 0
				} else {
					guanxi_id = this.list[this.list.length - 1].id + 1
				}
				this.list.push({
					id: guanxi_id,
					image: this.put.image,
					name: this.put.name,
					guanxi: this.put.guanxi,
					des: this.put.des
				})
				this.fileList5 = []
				this.put.name = ""
				this.put.image = {}
				this.put.guanxi = ""
				this.put.des = ""
				this.show = false
				console.log(this.datas.u_guanxi)
			},
			character(rbc) {
				this.list_index = rbc
				this.rbc.image = this.list[rbc].image
				this.fileList5.push({
					url: oss_host + this.list[rbc].image.url
				})
				this.rbc.name = this.list[rbc].name
				this.rbc.guanxi = this.list[rbc].guanxi
				this.rbc.des = this.list[rbc].des
				this.show1 = true
			},
			update() {
				this.list[this.list_index].image = {
					url: this.fileList5[0].url
				}
				this.list[this.list_index].name = this.rbc.name
				this.list[this.list_index].guanxi = this.rbc.guanxi
				this.list[this.list_index].des = this.rbc.des
				this.show1 = false
				this.fileList5 = []
			},
			delate() {
				this.show1 = false
				this.fileList5 = []
				this.list.splice(this.list_index, 1)

			},
			radioChange(evt) {
				console.log(evt)
			    for (let i = 0; i < this.items.length; i++) {
			        if (this.items[i].value === evt.detail.value) {
			            this.datas.is_accpass = i;
						console.log(i)                     
			            break;
			        }
			    }
			}
		},
		onReady() {
			//如果需要兼容微信小程序，并且校验规则中含有方法等，只能通过setRules方法设置规则。
			this.$refs.uForm.setRules(this.rules)
		},
	};
</script>
<style lang="scss">
	page {
		display: flex;
		align-items: center;
		justify-content: center;
		height: 100%;
.u-page {
		padding: 0;
	}

	.u-cell-icon {
		width: 36rpx;
		height: 36rpx;
		margin-right: 8rpx;
	}

	.u-cell-group__title__text {
		font-weight: bold;
	}
		.from_tips_text {
			color: rgba(255, 0, 0, 0.5);
			text-align: center;
			margin-top: 20rpx;
			margin-bottom: 20rpx;
		}

		.v_if_img {
			border-radius: 50px;
			width: 112rpx;
			height: 112rpx;
		}
	}
</style>